package com.sud.framework.system.httpUtil;

import java.util.HashMap;

/**
 * 功能：返回类型
 * 作者：SUD
 * 时间：2018/6/26 14:10
 */
public class Result extends HashMap<String,Object>{
    public final static String SUCCESS = "success";
    public final static String CODE = "code";
    public final static String MESSAGE = "message";

    public static Result ok(){
        Result result = new Result();
        result.put(SUCCESS,true);
        return result;
    }
    public static Result error(String message){
        Result result = new Result();
        result.put(SUCCESS,false);
        result.put(MESSAGE,message);
        return result;
    }
    public static Result error(ResultCode code,String message){
        Result result = new Result();
        result.put(SUCCESS,false);
        result.put(CODE,code);
        result.put(MESSAGE,message);
        return result;
    }
}
